package net.contrend.util;

import org.springframework.web.struts.DispatchActionSupport;
import org.springframework.context.ApplicationContext;

public class BaseAction extends DispatchActionSupport {
    
    protected final String ACTION_FORM_NAME = "form";
    protected final String ACTION_PAGE_EDIT = "edit";

    protected ApplicationContext context;
    
    public BaseAction() {
        this.context = this.getWebApplicationContext();
    }
    
    protected Object getBean(String name) {
        if (null == this.context) {
            this.context = this.getWebApplicationContext();
        }
        return this.context.getBean(name);
    }
}
